feat: added selection of drive for restoring#918
Open
gastoner wants to merge 1 commit intoFedoraQt:mainfrom
Open
feat: added selection of drive for restoring#918gastoner wants to merge 1 commit intoFedoraQt:mainfrom
gastoner wants to merge 1 commit intoFedoraQt:mainfrom
Conversation
fb126b8 to
7e1965e
Compare
grulja
requested changes
Jan 13, 2026
Collaborator
There was a problem hiding this comment.
I'm sorry, but the implementation of the RestoreableDriveManager seems to be odd.
Here are some recommendations:
- Add names to the roles in
DriveManager, currently they are not defined and juse justQt::UserRole + 1andQt::UserRole + 2. To that add something likeRestoreablerole so this is accessible property. This would look like:
enum ItemRole {
NameRole = Qt::DisplayRole,
DriveRole = Qt::UserRole + 1,
RestoreableRole
}
And do the needed adjustments in the DriveManager implementation
- Then the
RestoreableDriveManager::filterAcceptsRow()can look like:
const QModelIndex index = sourceModel()->index(source_row, 0, source_parent);
const bool isRestoreable = sourceModel()->data(index, DriveManger::RestoreableRole).toBool();
return isRestoreable;
- I don't think you have to override
QSortFilterProxyModel::roleNames()andQSortFilterProxyModel::data(). - And I think we can get rid of the logic with lastRestoreable or
selectedproperty that you just added and simply get the selected drive from the combobox using theDriveRole.
7e1965e to
33573bb
Compare
Signed-off-by: Evzen Gasta <[email protected]>
33573bb to
96163a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an option to select a drive for restoring
Closes #506